package com.token.sysflow.enumerate;

/**
 * @author chenjianxiong 2020/4/21
 */
public enum FlowTypeEnum {
    MAIN_FLOW(1,"主流程"),
    SUB_FLOW(2,"子流程");

    private final int id;
    private final String name;
    FlowTypeEnum(int key, String name) {
        this.id = key;
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public String getName(){
        return name;
    }


    /**
     *
     * @param value
     * @return
     */
    public static FlowTypeEnum getFlowTypeByValue(int value){
        for (FlowTypeEnum enums : FlowTypeEnum.values()) {
            if (enums.getId() == value) {
                return enums;
            }
        }
        return null;
    }
}
